| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

ContentLoader.h
1 // ContentLoader.h
3 //
5
6 namespace nkGraphics
7 {
11 class ContentLoader final
12 {
13 public :
14
15 // Constructor
21 ContentLoader (System* system) noexcept ;
22
30 nkExport::ExporterLoadResult inputData (nkMemory::StringView filePath) ;
37 nkMemory::String inputDataStr (nkMemory::StringView filePath) ;
45 nkExport::ExporterLoadResult inputDataSources (nkMemory::StringView sources) ;
54 bool outputData (nkMemory::StringView content, nkMemory::StringView path) ;
55
56 // Save
64 bool saveTreeDeclaration (nkExport::Node* tree, nkMemory::StringView pathFromData) ;
72 bool saveObjectDeclaration (nkExport::Exportable* object, nkMemory::StringView pathFromData) ;
73
74 // Textures
82 ContentLoadResultTexture loadTextureDeclaration (nkMemory::StringView pathFromData, bool loadResource = true) ;
90 ContentLoadResultTexture processTextureSources (nkMemory::StringView sources, bool loadResource = true) ;
98 ContentLoadResultTexture processTextureTree (nkExport::Node* tree, bool loadResource = true) ;
99 // Samplers
107 ContentLoadResultSampler loadSamplerDeclaration (nkMemory::StringView pathFromData, bool loadResource = true) ;
115 ContentLoadResultSampler processSamplerSources (nkMemory::StringView sources, bool loadResource = true) ;
123 ContentLoadResultSampler processSamplerTree (nkExport::Node* tree, bool loadResource = true) ;
124 // Shaders Program
132 ContentLoadResultProgram loadShaderProgramDeclaration (nkMemory::StringView pathFromData, bool loadResource = true) ;
140 ContentLoadResultProgram processShaderProgramSources (nkMemory::StringView sources, bool loadResource = true) ;
148 ContentLoadResultProgram processShaderProgramTree (nkExport::Node* tree, bool loadResource = true) ;
149 // Shader Memory Slot
156 ContentLoadResultShaderMemorySlot loadShaderMemorySlotDeclaration (nkMemory::StringView pathFromData) ;
163 ContentLoadResultShaderMemorySlot processShaderMemorySlotSources (nkMemory::StringView sources) ;
170 ContentLoadResultShaderMemorySlot processShaderMemorySlotDeclarationTree (nkExport::Node* tree) ;
171 // Constant Buffer
178 ContentLoadResultConstantBuffer loadConstantBufferDeclaration (nkMemory::StringView pathFromData) ;
185 ContentLoadResultConstantBuffer processConstantBufferSources (nkMemory::StringView sources) ;
192 ContentLoadResultConstantBuffer processConstantBufferDeclarationTree (nkExport::Node* tree) ;
193 // Compute Buffer
201 ContentLoadResultBuffer loadBufferDeclaration (nkMemory::StringView pathFromData, bool loadResource = true) ;
209 ContentLoadResultBuffer processBufferSources (nkMemory::StringView sources, bool loadResource = true) ;
217 ContentLoadResultBuffer processBufferDeclarationTree (nkExport::Node* tree, bool loadResource = true) ;
218 // Shader
226 ContentLoadResultShader loadShaderDeclaration (nkMemory::StringView pathFromData, bool loadResource = true) ;
234 ContentLoadResultShader processShaderDeclarationSources (nkMemory::StringView sources, bool loadResource = true) ;
242 ContentLoadResultShader processShaderDeclarationTree (nkExport::Node* tree, bool loadResource = true) ;
243 // Pass
250 ContentLoadResultPass loadPassDeclaration (nkMemory::StringView pathFromData) ;
257 ContentLoadResultPass processPassSources (nkMemory::StringView sources) ;
264 ContentLoadResultPass processPassTree (nkExport::Node* tree) ;
265 // Compositor
272 ContentLoadResultCompositor loadCompositorDeclaration (nkMemory::StringView pathFromData) ;
279 ContentLoadResultCompositor processCompositorSources (nkMemory::StringView sources) ;
286 ContentLoadResultCompositor processCompositorTree (nkExport::Node* tree) ;
287 // Meshes
295 ContentLoadResultMesh loadMeshDeclaration (nkMemory::StringView pathFromData, bool loadResource = true) ;
303 ContentLoadResultMesh processMeshSources (nkMemory::StringView sources, bool loadResource = true) ;
311 ContentLoadResultMesh processMeshTree (nkExport::Node* tree, bool loadResource = true) ;
312 // Nodes
319 ContentLoadResultNode loadNodeDeclaration (nkMemory::StringView pathFromData) ;
326 ContentLoadResultNode processNodeSources (nkMemory::StringView sources) ;
333 ContentLoadResultNode processNodeTree (nkExport::Node* tree) ;
334 // Blend States
342 ContentLoadResultBlendState loadBlendStateDeclaration (nkMemory::StringView pathFromData, bool loadResource = true) ;
350 ContentLoadResultBlendState processBlendStateSources (nkMemory::StringView sources, bool loadResource = true) ;
358 ContentLoadResultBlendState processBlendStateTree (nkExport::Node* tree, bool loadResource = true) ;
359 // Depth Stencil States
367 ContentLoadResultDepthStencilState loadDepthStencilStateDeclaration (nkMemory::StringView pathFromData, bool loadResource = true) ;
375 ContentLoadResultDepthStencilState processDepthStencilStateSources (nkMemory::StringView sources, bool loadResource = true) ;
383 ContentLoadResultDepthStencilState processDepthStencilStateTree (nkExport::Node* tree, bool loadResource = true) ;
384 // Raster States
392 ContentLoadResultRasterState loadRasterStateDeclaration (nkMemory::StringView pathFromData, bool loadResource = true) ;
400 ContentLoadResultRasterState processRasterStateSources (nkMemory::StringView sources, bool loadResource = true) ;
408 ContentLoadResultRasterState processRasterStateTree (nkExport::Node* tree, bool loadResource = true) ;
409 // Camera
416 ContentLoadResultCamera loadCameraDeclaration (nkMemory::StringView pathFromData) ;
423 ContentLoadResultCamera processCameraSources (nkMemory::StringView sources) ;
430 ContentLoadResultCamera processCameraTree (nkExport::Node* tree) ;
431 // Render Queues
438 ContentLoadResultRenderQueue loadRenderQueueDeclaration (nkMemory::StringView pathFromData) ;
445 ContentLoadResultRenderQueue processRenderQueueSources (nkMemory::StringView sources) ;
452 ContentLoadResultRenderQueue processRenderQueueTree (nkExport::Node* tree) ;
453
463 ContentLoadResultCompositorNode appendCompositorNodeFromFile (nkMemory::StringView pathFromData, Compositor* parent) ;
473 ContentLoadResultCompositorNode appendCompositorNodeFromSources (nkMemory::StringView sources, Compositor* parent) ;
483 ContentLoadResultCompositorNode appendCompositorNodeFromTree (nkExport::Node* tree, Compositor* parent) ;
484 } ;
485 }
nkGraphics::ContentLoader::processMeshSources
ContentLoadResultMesh processMeshSources(nkMemory::StringView sources, bool loadResource=true)
nkGraphics::ContentLoader::processBufferSources
ContentLoadResultBuffer processBufferSources(nkMemory::StringView sources, bool loadResource=true)
nkGraphics::ContentLoader::processNodeSources
ContentLoadResultNode processNodeSources(nkMemory::StringView sources)
nkGraphics::ContentLoader::loadRasterStateDeclaration
ContentLoadResultRasterState loadRasterStateDeclaration(nkMemory::StringView pathFromData, bool loadResource=true)
nkGraphics::System
Main interface with the component system.
Definition: System.h:14
nkGraphics::ContentLoader::processConstantBufferDeclarationTree
ContentLoadResultConstantBuffer processConstantBufferDeclarationTree(nkExport::Node *tree)
nkGraphics::ContentLoader::processShaderProgramSources
ContentLoadResultProgram processShaderProgramSources(nkMemory::StringView sources, bool loadResource=true)
nkGraphics::ContentLoader::loadCameraDeclaration
ContentLoadResultCamera loadCameraDeclaration(nkMemory::StringView pathFromData)
nkExport::Exportable
An interface to define objects that can be exported using this component.
Definition: Exportable.h:15
nkGraphics::ContentLoader::saveObjectDeclaration
bool saveObjectDeclaration(nkExport::Exportable *object, nkMemory::StringView pathFromData)
nkGraphics::Compositor
A compositor, describing how to compose the rendering pipeline.
Definition: Compositor.h:23
nkGraphics::ContentLoader::loadNodeDeclaration
ContentLoadResultNode loadNodeDeclaration(nkMemory::StringView pathFromData)
nkGraphics::ContentLoader::inputData
nkExport::ExporterLoadResult inputData(nkMemory::StringView filePath)
nkGraphics::ContentLoader::processShaderProgramTree
ContentLoadResultProgram processShaderProgramTree(nkExport::Node *tree, bool loadResource=true)
nkGraphics::ContentLoader::loadBufferDeclaration
ContentLoadResultBuffer loadBufferDeclaration(nkMemory::StringView pathFromData, bool loadResource=true)
nkGraphics::ContentLoader::inputDataSources
nkExport::ExporterLoadResult inputDataSources(nkMemory::StringView sources)
nkGraphics::ContentLoader::appendCompositorNodeFromSources
ContentLoadResultCompositorNode appendCompositorNodeFromSources(nkMemory::StringView sources, Compositor *parent)
nkExport::ExporterLoadResult
Holds the information about a try to import data sources.
Definition: ExporterLoadResult.h:15
nkGraphics::ContentLoader::processSamplerSources
ContentLoadResultSampler processSamplerSources(nkMemory::StringView sources, bool loadResource=true)
nkGraphics::ContentLoader::loadDepthStencilStateDeclaration
ContentLoadResultDepthStencilState loadDepthStencilStateDeclaration(nkMemory::StringView pathFromData, bool loadResource=true)
nkGraphics::ContentLoader::outputData
bool outputData(nkMemory::StringView content, nkMemory::StringView path)
nkGraphics::ContentLoader::loadConstantBufferDeclaration
ContentLoadResultConstantBuffer loadConstantBufferDeclaration(nkMemory::StringView pathFromData)
nkGraphics::ContentLoader::processBufferDeclarationTree
ContentLoadResultBuffer processBufferDeclarationTree(nkExport::Node *tree, bool loadResource=true)
nkGraphics::ContentLoader::processConstantBufferSources
ContentLoadResultConstantBuffer processConstantBufferSources(nkMemory::StringView sources)
nkGraphics::ContentLoader::processRenderQueueSources
ContentLoadResultRenderQueue processRenderQueueSources(nkMemory::StringView sources)
nkGraphics::ContentLoader::processMeshTree
ContentLoadResultMesh processMeshTree(nkExport::Node *tree, bool loadResource=true)
nkGraphics::ContentLoader::ContentLoader
ContentLoader(System *system) noexcept
nkGraphics::ContentLoader::saveTreeDeclaration
bool saveTreeDeclaration(nkExport::Node *tree, nkMemory::StringView pathFromData)
nkGraphics::ContentLoader::processSamplerTree
ContentLoadResultSampler processSamplerTree(nkExport::Node *tree, bool loadResource=true)
nkGraphics::ContentLoader::processDepthStencilStateTree
ContentLoadResultDepthStencilState processDepthStencilStateTree(nkExport::Node *tree, bool loadResource=true)
nkGraphics::ContentLoader::processShaderMemorySlotDeclarationTree
ContentLoadResultShaderMemorySlot processShaderMemorySlotDeclarationTree(nkExport::Node *tree)
nkExport::Node
A node in the tree structure representing the data to export / import.
Definition: Node.h:42
nkGraphics::ContentLoader::processPassTree
ContentLoadResultPass processPassTree(nkExport::Node *tree)
nkGraphics::ContentLoader::processBlendStateSources
ContentLoadResultBlendState processBlendStateSources(nkMemory::StringView sources, bool loadResource=true)
nkGraphics::ContentLoader::processCameraTree
ContentLoadResultCamera processCameraTree(nkExport::Node *tree)
nkGraphics::ContentLoader::processTextureSources
ContentLoadResultTexture processTextureSources(nkMemory::StringView sources, bool loadResource=true)
nkGraphics::ContentLoader::processCompositorSources
ContentLoadResultCompositor processCompositorSources(nkMemory::StringView sources)
nkGraphics::ContentLoader::processShaderMemorySlotSources
ContentLoadResultShaderMemorySlot processShaderMemorySlotSources(nkMemory::StringView sources)
nkGraphics::ContentLoader::processRenderQueueTree
ContentLoadResultRenderQueue processRenderQueueTree(nkExport::Node *tree)
nkGraphics::ContentLoader
Utility class that allows to load content through their declaration files.
Definition: ContentLoader.h:12
nkMemory::String
Class holding information about a string, with ownership over the data.
Definition: String.h:22
nkGraphics::ContentLoader::processTextureTree
ContentLoadResultTexture processTextureTree(nkExport::Node *tree, bool loadResource=true)
nkMemory::StringView
Class holding information about a string, with no ownership over the data.
Definition: StringView.h:22
nkGraphics::ContentLoader::processRasterStateTree
ContentLoadResultRasterState processRasterStateTree(nkExport::Node *tree, bool loadResource=true)
nkGraphics::ContentLoader::processCompositorTree
ContentLoadResultCompositor processCompositorTree(nkExport::Node *tree)
nkGraphics::ContentLoader::processDepthStencilStateSources
ContentLoadResultDepthStencilState processDepthStencilStateSources(nkMemory::StringView sources, bool loadResource=true)
nkGraphics::ContentLoader::loadSamplerDeclaration
ContentLoadResultSampler loadSamplerDeclaration(nkMemory::StringView pathFromData, bool loadResource=true)
nkGraphics::ContentLoader::loadPassDeclaration
ContentLoadResultPass loadPassDeclaration(nkMemory::StringView pathFromData)
nkGraphics::ContentLoader::appendCompositorNodeFromFile
ContentLoadResultCompositorNode appendCompositorNodeFromFile(nkMemory::StringView pathFromData, Compositor *parent)
nkGraphics::ContentLoader::processBlendStateTree
ContentLoadResultBlendState processBlendStateTree(nkExport::Node *tree, bool loadResource=true)
nkGraphics::ContentLoader::loadShaderDeclaration
ContentLoadResultShader loadShaderDeclaration(nkMemory::StringView pathFromData, bool loadResource=true)
nkGraphics::ContentLoader::appendCompositorNodeFromTree
ContentLoadResultCompositorNode appendCompositorNodeFromTree(nkExport::Node *tree, Compositor *parent)
nkGraphics::ContentLoadResult
Holds information about an attempt of parsing content declaration sources.
Definition: ContentLoadResult.h:23
nkGraphics::ContentLoader::loadShaderMemorySlotDeclaration
ContentLoadResultShaderMemorySlot loadShaderMemorySlotDeclaration(nkMemory::StringView pathFromData)
nkGraphics::ContentLoader::loadMeshDeclaration
ContentLoadResultMesh loadMeshDeclaration(nkMemory::StringView pathFromData, bool loadResource=true)
nkGraphics::ContentLoader::inputDataStr
nkMemory::String inputDataStr(nkMemory::StringView filePath)
nkGraphics::ContentLoader::processShaderDeclarationSources
ContentLoadResultShader processShaderDeclarationSources(nkMemory::StringView sources, bool loadResource=true)
nkGraphics::ContentLoader::loadBlendStateDeclaration
ContentLoadResultBlendState loadBlendStateDeclaration(nkMemory::StringView pathFromData, bool loadResource=true)
nkGraphics
Encompasses all API of component NilkinsGraphics.
Definition: BoundingBox.h:7
nkGraphics::ContentLoader::processPassSources
ContentLoadResultPass processPassSources(nkMemory::StringView sources)
nkGraphics::ContentLoader::loadShaderProgramDeclaration
ContentLoadResultProgram loadShaderProgramDeclaration(nkMemory::StringView pathFromData, bool loadResource=true)
nkGraphics::ContentLoader::loadRenderQueueDeclaration
ContentLoadResultRenderQueue loadRenderQueueDeclaration(nkMemory::StringView pathFromData)
nkGraphics::ContentLoader::loadCompositorDeclaration
ContentLoadResultCompositor loadCompositorDeclaration(nkMemory::StringView pathFromData)
nkGraphics::ContentLoader::processCameraSources
ContentLoadResultCamera processCameraSources(nkMemory::StringView sources)
nkGraphics::ContentLoader::processRasterStateSources
ContentLoadResultRasterState processRasterStateSources(nkMemory::StringView sources, bool loadResource=true)
nkGraphics::ContentLoader::loadTextureDeclaration
ContentLoadResultTexture loadTextureDeclaration(nkMemory::StringView pathFromData, bool loadResource=true)
nkGraphics::ContentLoader::processNodeTree
ContentLoadResultNode processNodeTree(nkExport::Node *tree)
nkGraphics::ContentLoader::processShaderDeclarationTree
ContentLoadResultShader processShaderDeclarationTree(nkExport::Node *tree, bool loadResource=true)